Sub WordCountSelection()
    Dim wordCount As Integer
    Dim rngWord As Range
    Dim reader As Variant
    Dim timeRequired As Double
    Dim minutes As Integer
    Dim seconds As Integer
    Dim resultString As String

    ' Readers and their reading speeds (words per minute)
    Dim readers As Variant
    readers = Array(Array("Name1", 111), Array("Name2", 111), Array("Name3", 111), _
                    Array("Name4", 111), Array("Name5", 111), Array("Name6", 111), Array("Name7", 111))

    ' Initialize the count
    wordCount = 0

    ' Check if there is a selection
    If Selection.Type = wdSelectionIP Then
        MsgBox "Please select the text first", vbExclamation
        Exit Sub
    End If

    ' Loop through each word in the selection
    For Each rngWord In Selection.Words
        ' Count if the word is highlighted or bold
        If rngWord.HighlightColorIndex <> wdNoHighlight Or rngWord.Font.Bold = True Then
            wordCount = wordCount + 1
        End If
    Next rngWord

    ' Calculate and format the reading time for each reader
    resultString = "Highlighted/bolded words selected: " & wordCount & vbCrLf
    For Each reader In readers
        timeRequired = wordCount / reader(1) ' Time in minutes
        minutes = Int(timeRequired) ' Whole minutes
        seconds = Int((timeRequired - minutes) * 60) ' Remaining seconds
        resultString = resultString & reader(0) & ": " & Format(minutes, "00") & ":" & Format(seconds, "00") & vbCrLf
    Next

    ' Display the result in a message box
    MsgBox resultString, vbInformation
End Sub
